//package IO.File;
//
//import org.junit.Test;
//
//import java.io.*;
//
//public class DeepCopyTest {
//    @Test
//    //浅拷贝
//    public void DeepCopy() throws CloneNotSupportedException {
//        User user = new User(12, "zhangsan");
//        user.setDog(new Dog(2));
//        User user1 = (User) user.clone();
//        user.setAge(13);
//        user.getDog().setAge(3);
//        System.out.println(user1);
//    }
//
//    @Test
//    public void DeepCopy2() throws CloneNotSupportedException, IOException, ClassNotFoundException {
//        User user = new User(12, "zhangsan");
//        user.setDog(new Dog(2));
//        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();//字节数组输出流
//        ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
//        objectOutputStream.writeObject(user);
//        byte[] bytes = outputStream.toByteArray();
//
//        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
//        ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
//        Object o = objectInputStream.readObject();
//        User user1 = (User) o;
//
//        user.setAge(44);
//        user.getDog().setAge(11);
//        System.out.println(user);
//        System.out.println(user1);
//
//    }
//    @Test
//    public void DeepCopy3() throws IOException, ClassNotFoundException {
//        User user = new User(12, "zhangsan");
//        user.setDog(new Dog(2));
//        User user1 = DeepCopyUtil.DeepCopy(user);
//
//        user.setAge(44);
//        user.getDog().setAge(11);
//        System.out.println(user);
//        System.out.println(user1);
//    }
//
//}
